<!--
 * @Author: Dorange.Wang
 * @Date: 2021-07-08 11:00:15
 * @LastEditors: your name
 * @LastEditTime: 2021-07-08 14:48:20
 * @Description: file content
-->
<template>
  <component
    v-if="widget.tagName === 'formItem'"
    :is="widget.tagName"
    :key="widget.key"
  />
  <Dynamic
    v-else
    :is="widget.tagName"
    :key="widget.key"
  />
</template>

<script>
export default {
  name: "Dynamic",
  
  props: {
    widget: {
      type: Object,
      required: true,
    },
  },

  computed:{
    tagName(){
      const {widget} = this
      return widget.__config.type || widget.tagName
    }
  }
};
</script>

<style></style>
